package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.entity.QueryPageBean;
import com.itheima.entity.Result;
import com.itheima.pojo.Medical;
import com.itheima.service.MedicalService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("medical")
public class MedicalController {

    @Reference(version = "1.0")
    MedicalService medicalService;

    @PostMapping("findPage")
    public Result findPage(@RequestBody QueryPageBean queryPageBean) {
        return medicalService.findPage(queryPageBean);
    }

    @PostMapping("save")
    public Result save(@RequestBody Medical medical){
        return medicalService.save(medical);
    }
    @PostMapping("update")
    public Result update(@RequestBody Medical medical){
        return medicalService.update(medical);
    }
    @GetMapping("findById")
    public Result findById(Integer medicalId){
        return medicalService.findById(medicalId);
    }
    @GetMapping("delete")
    public Result delete(Integer medicalId){
        return medicalService.delete(medicalId);
    }
}
